/*******************************************************************************
* Project: QSAR(Cute Software Architecture) 
*
* Copyright: Copyright(C) 2024 by YuetingBen, All Rights Reserved
*
* File name: MemAccType.h
*
* Brief: ;
*
* Author: Yueting.Ben
*
* Module: MemAcc
*
*******************************************************************************/

#ifndef MEMACCTYPE_H
#define MEMACCTYPE_H

/** HEADER FILES **/
#include "PlatformCfg.h" 


/** MACRO DEFINITION **/
#define MEMACC_ADDRESS_AREA_MAX        1u


/** TYPEDEF DEFINITION **/
typedef  uint16 MemAcc_AddressAreaIdType;

typedef uint32 MemAcc_AddressType;

typedef struct 
{
    uint8 test;
}MemAcc_ConfigType;

typedef uint8 MemAcc_DataType;

typedef uint8 MemAcc_JobResultType;
#define MEMACC_MEM_OK ((MemAcc_JobResultType)0u)
#define MEMACC_MEM_FAILED ((MemAcc_JobResultType)1u)
#define MEMACC_MEM_INCONSISTENT ((MemAcc_JobResultType)2u)
#define MEMACC_MEM_CANCELED ((MemAcc_JobResultType)3u)
#define MEMACC_MEM_ECC_UNCORRECTED ((MemAcc_JobResultType)4u)
#define MEMACC_MEM_ECC_CORRECTED ((MemAcc_JobResultType)5u)

typedef uint8 MemAcc_JobStatusType;
#define MEMACC_JOB_IDLE ((MemAcc_JobStatusType)0u)
#define MEMACC_JOB_PENDING ((MemAcc_JobStatusType)1u)

typedef uint8 MemAcc_JobType;
#define MEMACC_NO_JOB ((MemAcc_JobType)0u)
#define MEMACC_WRITE_JOB ((MemAcc_JobType)1u)
#define MEMACC_READ_JOB ((MemAcc_JobType)2u)
#define MEMACC_COMPARE_JOB ((MemAcc_JobType)3u)
#define MEMACC_ERASE_JOB ((MemAcc_JobType)4u)
#define MEMACC_MEMHWSPECIFIC_JOB ((MemAcc_JobType)5u)
#define MEMACC_BLANKCHECK_JOB ((MemAcc_JobType)6u)
#define MEMACC_REQUESTLOCK_JOB ((MemAcc_JobType)7u)

typedef uint32 MemAcc_LengthType;

typedef struct
{
    MemAcc_AddressType LogicalStartAddress;
    MemAcc_AddressType PhysicalStartAddress;
    MemAcc_LengthType MaxOffset;
    uint32 EraseSectorSize;
    uint32 EraseSectorBurstSize;
    uint32 ReadPageSize;
    uint32 WritePageSize;
    uint32 ReadPageBurstSize;
    uint32 WritePageBurstSize;
    uint32 HwId;
}MemAcc_MemoryInfoType;


typedef uint16 MemAccAddressAreaIdType;

typedef uint32 MemAccNumberOfSectorsType;

typedef uint32 MemAccLogicalStartAddressType;

typedef struct
{
    MemAccNumberOfSectorsType MemAccNumberOfSectors;
    MemAccLogicalStartAddressType MemAccLogicalStartAddress;
}MemAccSubAddressAreaConfigurationType;

typedef struct
{
    MemAccAddressAreaIdType MemAccAddressAreaId;
    MemAccSubAddressAreaConfigurationType MemAccSubAddressAreaConfiguration;
}MemAccAddressAreaConfigurationType;


#endif

